import request from "../../utils/request";

// 已完成 获取学生列表API
export function getStudentlist(querya) {
  return request({
    url: '/system/student/list',
    method: 'get',
    params: querya
  })
}


// 获取学院列表
export function getCollege() {
  return request({
    url: '/system/dept/list',
    method: 'get',
  })
}

// 获取班级列表  /student/class/list
export function getClass(query) {
  return request({
    url: '/student/class/list',
    method: 'get',
    params: query
  })
}

// 搜索学生
export function secrchStudent(querySearch) {
  return request({
    url: '/system/student/{id}',
    method: 'get',
    params: querySearch
  })
}

// 新增学生
export function addStudents(addData) {
  return request({
    url: '/system/student/add',
    method: 'POST',
    data: addData
  })
}

// 更新学生信息 完成80%
export function edit(data) {
  return request(({
    url: '/system/student/edit',
    method: 'POST',
    data: data,
  }))
}

//  已完成 删除学生
export function removeStudent(data) {
  return request({
    url: '/system/student/remove',
    method: 'delete',
    data
  })
}

// 修改密码为学号    /system/student/resetPwd
export function resetPwd(query) {
  return request({
    url: `/system/student/resetPwd?studentId=${query}`,
    method: 'POST',
  })
}


// 上传文件   导入  /system/student/import

export function importApi() {
  return request({
    url: '/system/student/import',
    method: 'POST',
  })
}

// 导出/system/student/partExport  POST
export function partExport(exportData) {
  return request({
    url: '/system/student/partExport',
    method: 'POST',
    data: exportData,
    responseType: 'arraybuffer'
  })
}

// 咨询记录   /record/list    GET
export function recordList(dataList, page) {
  return request({
    url: `/appointment/list?stuNum=${dataList}&pageNum=${page.pageNum}&pageSize=${page.pageSize}`,
    method: 'get',
    data: dataList,
  })
}

// 全部导出  /system/student/export
export function exportAll(exportAllList) {
  return request({
    url: '/system/student/export',
    method: 'POST',
    data: exportAllList,
    responseType: 'arraybuffer'
  })
}

// 导出全部复用
export function getStudentlistExport(querya) {
  return request({
    url: '/system/student/list',
    method: 'get',
    params: querya
  })
}



